<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Underscore演示实例</title>
    <!--<script type="text/javascript" src="../js/jquery-1.8.0.min.js"></script>-->
    <script type="text/javascript" src="../js/Underscore.js"></script>
    <script type="text/javascript">
        //        $(function () {
        //            _.each([1, 2, 3], alert);
        //        });

        window.onload = function () {
            var array = new Array();
            array[0] = 1;
            array[1] = 2;
            array[2] = 3;
            array[3] = 4;
            array[4] = 5;
            array[5] = 6;

            _.each(array, alert);

            var array1 = _.each(array, function (num, key) {
                return num * 3;
            });
            console.log(array1);

            var evens = _.filter(array, function (num) {
                return num % 2 == 0;
            });

            console.log(evens);
        }
    </script>
</head>
<body>

</body>
</html>